#include "pipe.hh"

#include <string>
#include <memory>
#include <vector>

class Area
{
public:
    Area(const std::string& filepath);

public:
    int getFarthestStep();
    int enclosedTiles();

    void print() const;

private:
    std::shared_ptr<Pipe> pipe(const Position& pos) const;
    int startX() const;
    int startY() const;
    bool isPosInvalid(const Position& pos) const;

private:
    std::vector<std::vector<std::shared_ptr<Pipe>>> _pipeArray;
    std::vector<std::vector<PipeType>> _pipeTypes;
    Position _startPosition;
    int _row;
    int _col;
};
